package compile;

import java.util.List;

/**
 * @author SongJun
 * @description 方法调用
 * @date 2021/9/28 15:33
 */
public class FunctionCall extends Statement {
    String name;
    List<String> parameters;
    FunctionDecl definition;

    public FunctionCall(String name, List<String> parameters) {
        this.name = name;
        this.parameters = parameters;
    }

    public static boolean isFunctionCallNode(Object node){
        if(node != null && node instanceof FunctionCall){
            return true;
        } else {
            return false;
        }
    }

    @Override
    public void dump(String prefix) {
        System.out.println(prefix+"FunctionCall "+this.name + (this.definition!=null ? ", resolved" : ", not resolved"));
        for(String x : parameters){
            System.out.println(prefix+"\t"+"Parameter: "+ x);
        }
    }
}
